package cn.tedu.mybatisannotation.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface CommentMapper {
    @Insert("INSERT INTO comment(content,user_id,weibo_id) VALUES (#{content},#{user_id},#{weibo_id})")
    int insert(@Param("content") String content, @Param("user_id") Integer userId, @Param("weibo_id") Integer weiboId);
//
//    @Insert("INSERT INTO comment(content,user_id,weibo_id) VALUES (#{content},#{user_id},#{weibo_id})")
//    int insert(String content,Integer user_id,Integer weibo_id);


    @Update("UPDATE  comment SET content=#{content} WHERE id=#{id}")
    int update(@Param("content") String cont, @Param("id") Integer id);

}
